<?php
class CommonAction extends Action {
	public function sendsms($phone,$str)
	{
		$result = file_get_contents('http://sms.mobset.com/SDK/Sms_Send.asp?CorpID=113635&LoginName=jxt&Passwd=792949&send_no='.$phone.'&msg='.iconv('UTF-8', 'GB2312', $str));
		
		$resultarr =explode(',',$result);
		if ($resultarr[0] ==1)
		{
			return 1;
		}
		else
		{
			return $result;
		}
	}
	
	public function randchar()
	{

		$chars = '0123456789';
		for ($i = 0; $i < 4; $i++)
		{
			$str .= $chars[ mt_rand(0, strlen($chars) - 1) ];
		}

		return $str;
	}

}